NoSQL

Back to Production-Engineering/Data-Stores

DB architectural design, opposed to SQL. The main advantage of NoSQL over SQL is that it can model data in different ways than a relational model, which can improve performance. A disadvantage is that NoSQL can result in very complicated data models

Database Normalization

In relational databases, it is the process of organizing columns and tables to reduce data redundancy. If multiple Books have the same genre, create a new table Genres with a row Sci-fi where genre attribute of the book points to this row.

Modelling Data

OO, we use classes and objects. In relational DBs, we use tables

Denormalization separates data into documents, of similar data

Object Oriented Design to Databases

One to Many relationships

Ownership pattern determines which model we should use

Many to Many

Relational needs a 3rd join table (again less performant)

NoSQL, we can do one-sided where all categories are stored in embedded arrays in products

Cassandra

Distributed NoSQL DB.

Distributed database for managing large amounts of structured data

Disadvantages:

Gossip Protocol

Communications protocol for spreading new information

Durability through Storage -- TODO source

Writes first to the CommitLog, and then to the Memtable, overflowing into disk as an SSTable

Data distribution

It is important to spread data across the cluster uniformly